<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="DistributionJobDay" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" resourceBundle="ru/apertum/qsystem/reports/templates/i3-label-rep" uuid="e0305b6f-345d-406c-b3e0-619c936bbe8e">
	<property name="ireport.zoom" value="1.0"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<parameter name="sdate" class="java.lang.String"/>
	<parameter name="date" class="java.util.Date"/>
	<queryString>
		<![CDATA[(SELECT '00' AS H, COUNT(*) AS C FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 00:00:00' AND '$P!{sdate} 01:00:00') UNION ALL
(SELECT '01', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 01:00:00' AND '$P!{sdate} 02:00:00') UNION ALL
(SELECT '02', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 02:00:00' AND '$P!{sdate} 03:00:00') UNION ALL
(SELECT '03', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 03:00:00' AND '$P!{sdate} 04:00:00') UNION ALL
(SELECT '04', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 04:00:00' AND '$P!{sdate} 05:00:00') UNION ALL
(SELECT '05', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 05:00:00' AND '$P!{sdate} 06:00:00') UNION ALL
(SELECT '06', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 06:00:00' AND '$P!{sdate} 07:00:00') UNION ALL
(SELECT '07', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 07:00:00' AND '$P!{sdate} 08:00:00') UNION ALL
(SELECT '08', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 08:00:00' AND '$P!{sdate} 09:00:00') UNION ALL
(SELECT '09', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 09:00:00' AND '$P!{sdate} 10:00:00') UNION ALL
(SELECT '10', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 10:00:00' AND '$P!{sdate} 11:00:00') UNION ALL
(SELECT '11', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 11:00:00' AND '$P!{sdate} 12:00:00') UNION ALL
(SELECT '12', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 12:00:00' AND '$P!{sdate} 13:00:00') UNION ALL
(SELECT '13', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 13:00:00' AND '$P!{sdate} 14:00:00') UNION ALL
(SELECT '14', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 14:00:00' AND '$P!{sdate} 15:00:00') UNION ALL
(SELECT '15', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 15:00:00' AND '$P!{sdate} 16:00:00') UNION ALL
(SELECT '16', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 16:00:00' AND '$P!{sdate} 17:00:00') UNION ALL
(SELECT '17', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 17:00:00' AND '$P!{sdate} 18:00:00') UNION ALL
(SELECT '18', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 18:00:00' AND '$P!{sdate} 19:00:00') UNION ALL
(SELECT '19', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 19:00:00' AND '$P!{sdate} 20:00:00') UNION ALL
(SELECT '20', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 20:00:00' AND '$P!{sdate} 21:00:00') UNION ALL
(SELECT '21', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 21:00:00' AND '$P!{sdate} 22:00:00') UNION ALL
(SELECT '22', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 22:00:00' AND '$P!{sdate} 23:00:00') UNION ALL
(SELECT '23', COUNT(*) FROM statistic WHERE state_in<>0 AND  client_stand_time BETWEEN '$P!{sdate} 23:00:00' AND '$P!{sdate} 23:59:59')]]>
	</queryString>
	<field name="H" class="java.lang.String">
		<fieldDescription><![CDATA[]]></fieldDescription>
	</field>
	<field name="C" class="java.lang.Integer">
		<fieldDescription><![CDATA[]]></fieldDescription>
	</field>
	<variable name="amount" class="java.lang.Integer" calculation="Sum">
		<variableExpression><![CDATA[$F{C}]]></variableExpression>
		<initialValueExpression><![CDATA[new java.lang.Integer(0)]]></initialValueExpression>
	</variable>
	<title>
		<band height="67">
			<line>
				<reportElement uuid="091cbf99-a3e6-42bd-9ffd-65d6d2932c84" x="0" y="8" width="555" height="1"/>
			</line>
			<line>
				<reportElement uuid="3767651a-3827-42b9-a067-79eb464e4bc7" positionType="FixRelativeToBottom" x="0" y="59" width="555" height="1"/>
			</line>
			<textField>
				<reportElement uuid="047833c9-59e5-4b33-bafb-80a2221a2828" x="1" y="9" width="551" height="24"/>
				<textElement textAlignment="Center" markup="none">
					<font fontName="SansSerif" size="18" isBold="true" pdfFontName="tahoma.ttf" pdfEncoding="KOI8-R" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$R{distribution_job_day}]]></textFieldExpression>
			</textField>
			<textField pattern="">
				<reportElement uuid="67925d6e-ad50-442a-b054-52f1add85c8b" x="1" y="34" width="551" height="24"/>
				<textElement textAlignment="Center">
					<font fontName="SansSerif" size="18" isBold="true" isUnderline="false" pdfFontName="tahoma.ttf" pdfEncoding="KOI8-R" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$R{on_date} + " " + (new java.text.SimpleDateFormat("dd.MM.yyyy")).format($P{date})]]></textFieldExpression>
			</textField>
		</band>
	</title>
	<pageHeader>
		<band/>
	</pageHeader>
	<columnHeader>
		<band height="487">
			<barChart>
				<chart isShowLegend="false" evaluationTime="Report">
					<reportElement uuid="4c411b09-4026-4215-b825-d47c12eb0c37" x="0" y="0" width="555" height="454"/>
					<chartTitle/>
					<chartSubtitle>
						<font fontName="SansSerif" size="14" isBold="false" pdfFontName="tahoma.ttf" pdfEncoding="KOI8-R" isPdfEmbedded="true"/>
						<subtitleExpression><![CDATA[]]></subtitleExpression>
					</chartSubtitle>
					<chartLegend/>
				</chart>
				<categoryDataset>
					<categorySeries>
						<seriesExpression><![CDATA[new java.lang.Integer(1)]]></seriesExpression>
						<categoryExpression><![CDATA[$F{H}]]></categoryExpression>
						<valueExpression><![CDATA[$F{C}]]></valueExpression>
					</categorySeries>
				</categoryDataset>
				<barPlot isShowTickMarks="false">
					<plot/>
					<itemLabel/>
					<categoryAxisLabelExpression><![CDATA[$R{hours}]]></categoryAxisLabelExpression>
					<categoryAxisFormat>
						<axisFormat/>
					</categoryAxisFormat>
					<valueAxisLabelExpression><![CDATA[$R{amount_of_clients}]]></valueAxisLabelExpression>
					<valueAxisFormat>
						<axisFormat/>
					</valueAxisFormat>
				</barPlot>
			</barChart>
			<textField evaluationTime="Report">
				<reportElement uuid="720d5c5a-5046-4dad-a99d-20c60f51be8b" x="1" y="454" width="554" height="20"/>
				<textElement textAlignment="Center">
					<font size="12" isBold="true" pdfFontName="tahoma.ttf" pdfEncoding="KOI8-R" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$R{clients_total_day}+": " + $V{amount}]]></textFieldExpression>
			</textField>
		</band>
	</columnHeader>
	<pageFooter>
		<band height="21">
			<textField evaluationTime="Report" pattern="" isBlankWhenNull="false">
				<reportElement uuid="5305791c-8305-4dc7-b9e1-8636ee150944" key="textField" x="516" y="2" width="36" height="19" forecolor="#000000" backcolor="#FFFFFF"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement>
					<font fontName="SansSerif" size="10" pdfFontName="tahoma.ttf" pdfEncoding="KOI8-R" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression><![CDATA["" + $V{PAGE_NUMBER}]]></textFieldExpression>
			</textField>
			<textField pattern="" isBlankWhenNull="false">
				<reportElement uuid="9eb0d818-b566-4195-a86b-6f927b9ffb28" key="textField" x="203" y="2" width="309" height="19" forecolor="#000000" backcolor="#FFFFFF"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement textAlignment="Right">
					<font fontName="SansSerif" size="10" pdfFontName="tahoma.ttf" pdfEncoding="KOI8-R" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$R{page}+" " + $V{PAGE_NUMBER} + " "+$R{from}+" "]]></textFieldExpression>
			</textField>
			<textField pattern="" isBlankWhenNull="false">
				<reportElement uuid="05eb839b-d585-42b6-83ad-46dda2713aba" key="textField" x="1" y="2" width="136" height="19" forecolor="#000000" backcolor="#FFFFFF"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement>
					<font fontName="SansSerif" size="10" pdfFontName="tahoma.ttf" pdfEncoding="KOI8-R" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression><![CDATA[new Date()]]></textFieldExpression>
			</textField>
		</band>
	</pageFooter>
</jasperReport>
